﻿/*****************************************************************//**
 * @file    FITKGraphObjectGeoPart.h
 * @brief   Geometry part graph object for VTK graph widget.
 *
 * @sa
 * FITKPartDataSetManager FITKGraphObjectModelHighlighting
 *
 * @author  ChengHaotian (yeguangbaozi@foxmail.com)
 * @date    2024-11-27
 *********************************************************************/

#ifndef __FITKGRAPHOBJECTGEOPART_H__
#define __FITKGRAPHOBJECTGEOPART_H__

#include "FITKGraphObjectGeoModelBase.h"

#include "FITKVTKGraphAdaptorAPI.h"

#include <QVector>

// Forward declaration
namespace AbaqusData
{
    class FITKAbaqusPart;
}

namespace Exchange
{
    /**
     * @brief   Geometry part graph object for VTK graph widget.
     * @author  ChengHaotian (yeguangbaozi@foxmail.com)
     * @date    2024-11-27
     */
    class FITKVTKGRAPHADAPTORAPI FITKGraphObjectGeoPart : public FITKGraphObjectGeoModelBase
    {
        // Regist
        FITKGraphObjectRegist(FITKGraphObjectGeoPart, FITKGraphObjectGeoModelBase);
        FITKCLASS(Exchange, FITKGraphObjectGeoPart);

    public:
        /**
         * @brief   Constructor.
         * @param   caseData: The case data
         * @param   part: The part data object
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-27
         */
        FITKGraphObjectGeoPart(AbaqusData::FITKDataCase* caseData, AbaqusData::FITKAbaqusPart* part);

        /**
         * @brief   Destructor.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-27
         */
        ~FITKGraphObjectGeoPart() = default;

        ///**
        // * @brief   Update all graph actors.[override]
        // * @param   forceUpdate: Force update[default]
        // * @author  ChengHaotian (yeguangbaozi@foxmail.com)
        // * @date    2024-12-30
        // */
        //void update(bool forceUpdate = false) override;

        /**
         * @brief   Unused.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-12-02
         */
        void colorByDefaultProperty(bool forceUpdate = false) override
        {
            Q_UNUSED(forceUpdate);
        }

        /**
         * @brief   Set the default color to the model.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-12-02
         */
        void colorByDefault(bool forceUpdate = false) override;

        /**
         * @brief   Unused.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-12-02
         */
        void colorByMaterial(bool forceUpdate = false) override
        {
            Q_UNUSED(forceUpdate);
        }

        /**
         * @brief   Unused.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-12-02
         */
        void colorBySection(bool forceUpdate = false) override
        {
            Q_UNUSED(forceUpdate);
        }

        /**
         * @brief   Set the graph actors to the default mesh color.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-12-13
         */
        void colorByDefaultMesh(bool forceUpdate = false) override;

    private:
        /**
         * @brief   Initialize.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-27
         */
        void init() override;

        /**
         * @brief   Get the part data object from the data object of the graph.[override]
         * @return  The part data object
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-12-11
         */
        AbaqusData::FITKAbaqusPart* getPartData() override;

        /**
         * @brief   Generate the shape with the vtkDataSet.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-27
         */
        void generateGraph() override;

    };
}   // namespace Exchange

#endif // __FITKGRAPHOBJECTGEOPART_H__
